<?php
namespace app\home\controller;

class Esc
{
   function index(){
   		return view('public:esc');
    }
    function getdata(){
    	$city = input('city');
    	$page = input('page');
		$url = 'http://'.$city.'.baixing.com/weishop/brands/ershouqiche/?&page='.$page;
        $ql = \QL\QueryList::get($url);	
        $data = $ql->rules([
        	'title'=>array('.exhibition h3 .company-title','text'),
		    'tel'=>array('.exhibition .exhibition-main p:contains("联系方式")','text')
		])->query()->getData();
		$ret = $data->all();
		return $ret;
		/*foreach ($ret as $key => $value) {
			echo 'BEGIN:VCARD<br/>VERSION:3.0<br/>N:'.$value["title"].';;;;<br/>FN:'.$value["title"].'<br/>TEL;TYPE=CELL:'.$value["tel"].'<br/>END:VCARD<br/>';

		}*/
        //P($data->all());
    }
}
